package com.gxa.employment.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxa.employment.entity.dto.ClazzAddListDto;
import com.gxa.employment.entity.dto.ClazzNotEmploymentDto;
import com.gxa.employment.entity.dto.ClazzSearchDto;
import com.gxa.employment.entity.pojo.Clazz;
import com.gxa.employment.entity.pojo.ClazzEmpStu;
import com.gxa.employment.entity.pojo.ClazzStudent;
import com.gxa.employment.entity.vo.StuClazzIvwVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 班级信息表 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-03-25
 */
@Mapper
public interface ClazzMapper extends BaseMapper<Clazz> {
    //批量上传
    Integer insertClazzBitch(ClazzAddListDto clazzAddListDto);
    //根据班级名字，班级状态，分页，查询班级信息
    List<ClazzStudent> getClazzStudentReport(ClazzSearchDto clazzSearchDto);
   //    根据班级名字，班级状态，查询总个数
    Long getClazzStudentReportCount(ClazzSearchDto clazzSearchDto);

    /**
     * 根据班级ID获取就业天数
     *
     * @param clazzId 班级ID
     * @return 就业天数
     */
    Integer getClazzDaysByClazzId(@Param("clazzId") Integer clazzId);

    /**
     * 更新班级的开始日期和结束日期
     */
    Integer updateClazzDates(
            @Param("clazzId") Integer clazzId,
            @Param("newStartDate") LocalDate newStartDate,
            @Param("newEndDate") LocalDate newEndDate
    );

    @Select("SELECT * FROM v_clazz_emp_stu")
    List<ClazzEmpStu> getClazzEmploymentDetails();

    List<StuClazzIvwVo> getNotStudent(ClazzSearchDto clazzSearchDto);
    List<StuClazzIvwVo> getStudent(ClazzSearchDto clazzSearchDto);
    Integer getNotStudentCount(ClazzSearchDto clazzSearchDto);
    Integer getStudentCount(ClazzSearchDto clazzSearchDto);
    Integer updateClazzStatus(List<ClazzNotEmploymentDto> stringList);

}
